Electronic device and method for searching related terms

ABSTRACT

A method for searching related terms first calculates a direct relationship between every two of a plurality of query terms to obtain a direct related matrix, and calculates a related score between every two of the query terms to obtain a related score matrix. The method further calculates an indirect relationship between every two of the query terms according to the direct relationship and the related score, and determines indirect terms of each query term according to the indirect relationship between every two of the query terms.

BACKGROUND

1. Technical Field

Embodiments of the present disclosure relate to file search technology,and particularly to an electronic device and method for searchingrelated terms using the electronic device.

2. Description of Related Art

Related terms of preset query terms can be obtained using a naturallanguage processing (NLP) method by calculating a relationship betweenevery two of the preset query terms. However, the NLP technology onlycalculates a direct relationship between every two of the preset queryterms, and generates the related terms having the direct relation withthe preset query terms. That is to say, the NLP technology cannotcalculate an indirect relationship between every two of the preset queryterms to generate the related terms having the indirect relationshipwith the preset query terms, which influences search resultscorresponding to the preset query terms.

For example, suppose that a query term is “baseball,” the query term“baseball” has a direct relationship with a first term “sport,” and thefirst term “sport” further has a direct relationship with a second term“basketball.” Thus, the query term “baseball” has an indirect relationwith the second term “basketball.” The NLP technology can determine thefirst term “sport” as the related term of the query term “baseball,” butcannot determine the second term “basketball” as the related term of thequery term “baseball.” It is thus less than efficient to implement asearch operation according to the query term. Therefore, a moreefficient method for searching related terms is desired.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of one embodiment of an electronic deviceincluding a related term search system.

FIG. 2 is a block diagram of one embodiment of the related term searchsystem included in the electronic device of FIG. 1.

FIG. 3 is a flowchart of one embodiment of a method for searchingrelated terms using the electronic device of the FIG. 1.

FIG. 4 is a topological diagram of direct relationship between aplurality of query terms.

FIG. 5 is an example of a direct related matrix created from thetopological diagram of FIG. 4.

FIGS. 6 and 7 are exemplary schematic diagrams of related score matricesobtained from FIG. 5.

FIG. 8 is an exemplary topological diagram of indirect relationship of aplurality of query terms.

FIG. 9 is an example of an indirect related matrix created from thetopological diagram of FIG. 8.

DETAILED DESCRIPTION

All of the processes described below may be embodied in, and fullyautomated via, functional code modules executed by one or more generalpurpose electronic devices or processors. The code modules may be storedin any type of non-transitory readable medium or other storage device.Some or all of the methods may alternatively be embodied in specializedhardware. Depending on the embodiment, the non-transitory readablemedium may be a hard disk drive, a compact disc, a digital video disc, atape drive or other suitable storage medium.

FIG. 1 is a block diagram of one embodiment of an electronic device 2including a related term search system 24. In the embodiment, theelectronic device 2 further includes a display device 20, an inputdevice 22, a storage device 23, and at least one processor 25. Therelated term search system 24 may be used to determine related termshaving indirect relationships with a plurality of query terms stored inthe storage device 23. A detailed description will be given in thefollowing paragraphs.

The display device 20 may be used to display search results matched withthe determined related terms, and the input device 22 may be a mouse ora keyboard used to input computer readable data.

FIG. 2 is a block diagram of one embodiment of the related term searchsystem 24 in the electronic device 2. In one embodiment, the relatedterm search system 24 may include one or more modules, for example, afirst calculation module 201, a second calculation module 202, a thirdcalculation module 203, a related term determining module 204, and asearching module 205. The one or more modules 201-204 may comprisecomputerized code in the form of one or more programs that are stored inthe storage device 23 (or memory). The computerized code includesinstructions that are executed by the at least one processor 25 toprovide functions for the one or more modules 201-204.

FIG. 3 is a flowchart of one embodiment of a method for searchingrelated terms using the electronic device 2. Depending on theembodiment, additional blocks may be added, others removed, and theordering of the blocks may be changed.

In block S1, the first calculation module 201 calculates a directrelationship “R_(i, j)” between every two of a plurality of query terms,and obtains a direct related matrix “R” according to all the calculateddirect relationship. In one embodiment, the query terms may be inputtedby a user, or stored in the storage device 23 in advance. As shown inFIG. 4, a direct relationship from “Term₁” to “Term₂” is 2, but a directrelationship from “Term₂” to “Term₁” is 1. That is to say, the directrelationship between two terms is determined according to a sequence ofthe two terms. As shown in FIG. 5, R_(i, j) represents the directrelationship from “Term_(i)” to “Term_(j)”, which is referred to asRelation(term_(i), term_(j)).

In block S2, the second calculation module 202 calculates a relatedscore between every two of the query terms, obtains a related scorematrix according to all the calculated related scores, and stores therelated score matrix in the storage device 23. In one embodiment, therelated score between every two of the query terms is obtained bycalculating a conditional probability between every two of the queryterms. As shown in FIG. 6, each element “P_(i, j)” in the related scorematrix “P” represents a conditional probability between “Term_(i)” and“Term_(j)”, where P_(i, j)=P((Term_(i)∩Term_(j))|Term_(i)). For example,assume that an occurrence number of a term “A” is 100, and an occurrencenumber of a term “B” is 30 given the occurrence of the term “A”. Thus,P(A∩B)|A)=0.3, that is, the related score from the term “A” to the term“B” is 30%.

In other embodiments, the second calculation module 202 may calculatethe related score using other methods to obtain the related scorematrix. For example, assume that a direct relationship from the term “A”to the term “B” is 100, and a direct relationship from the term “B” to aterm “C” is 300, where no other terms have a direct relationship withthe term “B,” which is referred to as A→B→C. Thus, a total related valueof the term “B” equals to (100+300)=400, where the term “A” occupies 100(i.e., 25%), the term “C” occupies 300 (i.e., 75%). That is to say, therelated score between the term “B” and the term “C” equals to 0.75, andan indirect relationship between the term “A” and the term “C” equals to100*0.75=75. Using this method, the second calculation module 202 maycalculate the related score between every two terms of the query termsin FIG. 5, and obtain a related score matrix “P′,” which is shown inFIG. 7, according to the calculated related scores.

In block S3, the third calculation module 203 calculates an indirectrelationship “R′_(i, j)” between every two of the query terms accordingto the direct relationship “R_(i, j)” and the related score “P_(i, j)”between every two terms, and stores the calculated indirectrelationships in the storage device 23. In one embodiment, the indirectrelationship “R′_(i, j)” between every two terms of the query terms iscalculated by a formula of R′_(i, j)=Σ_(K=1) ^(n)R_(i, k)*P_(k, j),k≠i,k, where the variable “n” represents a total number of the queryterms, for example, n=7 as shown in FIG. 4. FIG. 8 shows an exemplarytopological diagram of the indirect relationship between “Term₁” andother query terms. FIG. 9 shows an example of an indirect related matrix“R′” created from the topological diagram of FIG. 8, where each element“R′_(i, j)” in the indirect related matrix “R′” represents an indirectrelationship between “Term_(i)” and “Term_(j)”.

In block S4, the related term determining module 204 determines indirectterms of each query term according to the indirect relationship betweenevery two terms of the query terms, and stores the determined indirectterms in the storage device 23 of the electronic device 2. Then, thesearching module 205 performs a search operation according to thedetermined indirect terms to obtain search results from a data source,and displays the search results on the display device 20 of theelectronic device 2. The data source may be the Internet, at least onedatabase, or at least one file system. In one embodiment, the relatedterm determining module 204 determines that a first term of the queryterm is the indirect term of a second term of the query terms if theindirect relationship between the first term and the second term isgreater than or equal to a preset value. The preset value may be 1.0.For example, as shown in FIG. 9, the indirect terms of “Term₁” include“Term₃,” “Term₄,” “Term₅,” and “Term₇” whose indirect relationships aregreater than 1.0.

In one embodiment, if the term “A” has the direct relationship with theterm “B,” and the term “B” further has the direction relationship withthe term “C,” which is referred to as A→B→C. Then the related termsearch system 24 determines that the term “A” has the indirectrelationship with the term “C”, which is called a second-levelrelationship. In other embodiments, the system 24 may determine athird-level relationship or multi-level relationship using theabove-mentioned method. For example, if the term “A” has the directrelationship with the term “B,” the term “B” further has the directionrelationship with the term “C,” and the term “C” further has thedirection relationship with a term “D,” which is referred to as A→B→C→D.Then the system 24 determines that the term “A” has the indirectrelationship with the term “D”, which is called the third-levelrelationship.

It should be emphasized that the above-described embodiments of thepresent disclosure, particularly, any embodiments, are merely possibleexamples of implementations, merely set forth for a clear understandingof the principles of the disclosure. Many variations and modificationsmay be made to the above-described embodiment(s) of the disclosurewithout departing substantially from the spirit and principles of thedisclosure. All such modifications and variations are intended to beincluded herein within the scope of this disclosure and the presentdisclosure and protected by the following claims.

What is claimed is:
 1. A method for searching related terms using anelectronic device, the method comprising: obtaining a plurality of queryterms from a storage device of the electronic device; calculating adirect relationship “R_(i, j)” between every two of the query terms, andobtaining a direct related matrix “R” according to the directrelationships; calculating a related score “P_(i, j)” between every twoof the query terms, and obtaining a related score matrix “P” accordingto the related scores; calculating an indirect relationship “R′_(i, j)”between every two of the query terms according to the directrelationship “R_(i, j)” and the related score “P_(i, j)” between everytwo terms; determining indirect terms of each query term according tothe indirect relationship between every two of the query terms, andstoring the determined indirect terms in the storage device of theelectronic device, a first term of the query term being determined asthe indirect term of a second term of the query terms upon the conditionthat the indirect relationship between the first term and the secondterm is greater than or equal to a preset value; and obtaining searchresults from a data source by performing a search operation according tothe determined indirect terms, and displaying the search results on adisplay device of the electronic device.
 2. The method according toclaim 1, wherein the related score “P_(i, j)” between every two of thequery terms is obtained by calculating a conditional probability betweenevery two of the query terms.
 3. The method according to claim 1,wherein the indirect relationship “R′_(i, j)” between every two of thequery terms is calculated by a formula of R′_(i, j)=Σ_(K=1)^(n)R_(i, k)*P_(k, j), k≠i,k, wherein the variable “n” represents atotal number of the query terms.
 4. The method according to claim 1,wherein the preset value is 1.0.
 5. An electronic device, comprising: astorage device; at least one processor; and one or more modules that arestored in the storage device and are executed by the at least oneprocessor, the one or more modules comprising instructions: to obtain aplurality of query terms from the storage device; to calculate a directrelationship “R_(i, j)” between every two of the query terms, and obtaina direct related matrix “R” according to the calculated directrelationships; to calculate a related score “P_(i, j)” between every twoterms of the query terms, and obtain a related score matrix “P”according to the calculated related scores; to calculate an indirectrelationship “R′_(i, j)” between every two of the query terms accordingto the direct relationship “R_(i, j)” and the related score “P_(i, j)”between every two terms; to determine indirect terms of each query termaccording to the indirect relationship between every two of the queryterms, and store the determined indirect terms in the storage device, afirst term of the query term being determined as the indirect term of asecond term of the query terms upon the condition that the indirectrelationship between the first term and the second term is greater thanor equal to a preset value; and to obtain search results from a datasource by performing a search operation according to the determinedindirect terms, and display the search results on a display device ofthe electronic device.
 6. The electronic device according to claim 5,wherein the related score “P_(i, j)” between every two of the queryterms is obtained by calculating a conditional probability between everytwo of the query terms.
 7. The electronic device according to claim 5,wherein the indirect relationship “R′_(i, j)” between every two of thequery terms is calculated by a formula of R′_(i, j)=Σ_(K=1)^(n)R_(i, k)*P_(k, j), k≠i,k, wherein the variable “n” represents anumber of the query terms.
 8. The electronic device according to claim5, wherein the preset value is 1.0.
 9. A non-transitory storage mediumhaving stored thereon instructions that, when executed by a processor ofan electronic device, causes the processor to perform a method forsearching related terms using the electronic device, the methodcomprising: obtaining a plurality of query terms from a storage deviceof the electronic device; calculating a direct relationship “R_(i, j)”between every two of the query terms, and obtaining a direct relatedmatrix “R” according to the calculated direct relationships; calculatinga related score “P_(i, j)” between every two terms of the query terms,and obtaining a related score matrix “P” according to the calculatedrelated scores; calculating an indirect relationship “R′_(i, j)” betweenevery two of the query terms according to the direct relationship“R_(i, j)” and the related score “P_(i, j)” between every two terms;determining indirect terms of each query term according to the indirectrelationship between every two of the query terms, and storing thedetermined indirect terms in the storage device of the electronicdevice, a first term of the query term being determined as the indirectterm of a second term of the query terms upon the condition that theindirect relationship between the first term and the second term isgreater than or equal to a preset value; and obtaining search resultsfrom a data source by performing a search operation according to thedetermined indirect terms, and displaying the search results on adisplay device of the electronic device.
 10. The non-transitory storagemedium according to claim 9, wherein the related score “P_(i, j)”between every two of the query terms is obtained by calculating aconditional probability between every two of the query terms.
 11. Thenon-transitory storage medium according to claim 9, wherein the indirectrelationship “R′_(i, j)” between every two of the query terms iscalculated by a formula of R′_(i, j)=Σ_(K=1) ^(n)R_(i, k)*P_(k, j),k≠i,k, wherein the variable “n” represents a total number of the queryterms.
 12. The non-transitory storage medium according to claim 9,wherein the preset value is 1.0.
 13. The non-transitory storage mediumaccording to claim 9, wherein the medium is selected from the groupconsisting of a hard disk drive, a compact disc, a digital video disc,and a tape drive.